﻿using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using LSA.Framework;

namespace Visuals
{
    /// <summary>
    /// Interaction logic for WordGroupsPreview.xaml
    /// </summary>
    public partial class WordGroupsPreviewWindow : Window
    {
        public int WordId;
        public WordGroupsPreviewWindow(List<WordRelationPair>[] words, GetStringForWordId deleg)
        {
            InitializeComponent();

            for (int i = 0; i < words.Length; i++)
            {
                if (i % 3 == 0)
                {
                    var rowDefinition = new RowDefinition();
                    grid.RowDefinitions.Add(rowDefinition);
                }

                var control = new GroupPreviewControl(i.ToString(), words[i], deleg);
                control.SetValue(Grid.RowProperty, (int) i / 3);
                control.SetValue(Grid.ColumnProperty, (int) i % 3);
                grid.Children.Add(control);
            }
        }
    }
}
